package main

import (
	"svn-deploy-go/lib"
	"svn-deploy-go/lib/console"
	"flag"
	"runtime"
)

func main() {
	conf_path := flag.String("c", "config.json", "config json file")
	var mode string
	flag.StringVar(&mode, "mode", "http", "run mode console|http")
	flag.Parse()

	runtime.GOMAXPROCS(runtime.NumCPU())

	err, c := lib.NewConfig(*conf_path)
	if err != nil {
		return
	}

	if mode == "console" {
		console.StartConsole(c)
	}
	if mode == "http" {
		service := lib.NewHTTP(c)
		service.Start()
	}

}
